﻿
Partial Class Public_Downloads_DownloadFile
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim GetFile As String = Request.QueryString("F")
        Dim FilePath As String = ""

        If GetFile.IndexOf("?") <> -1 Then
            GetFile = GetFile.Substring(0, GetFile.IndexOf("?"))
        End If
        FilePath = Server.MapPath(System.Web.Configuration.WebConfigurationManager.AppSettings("DescriptionPath")) & GetFile.ToString() & ".doc"

        If System.IO.File.Exists(FilePath) Then
            Response.Redirect(Me.ResolveUrl(System.Web.Configuration.WebConfigurationManager.AppSettings("DescriptionPath") & GetFile.ToString() & ".doc"))
        Else
            MyObj.ShowMessage("目前無檔案可供下載!!")
            Return
        End If
    End Sub
End Class
